﻿@model Pescar2013Shop_MaruMati.Controllers.ProductoForm

@{
    ViewBag.Title = "Administración";
}
<html><head><title>@ViewBag.Title</title></head><body>
<h2>Create</h2>

@using (Html.BeginForm(null, null, FormMethod.Post, new { enctype = "multipart/form-data" }
	     )) 
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Producto</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Nombre)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Nombre)
            @Html.ValidationMessageFor(model => model.Nombre)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Modelo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Modelo)
            @Html.ValidationMessageFor(model => model.Modelo)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Precio)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Precio)
            @Html.ValidationMessageFor(model => model.Precio)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Descripcion)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Descripcion)
            @Html.ValidationMessageFor(model => model.Descripcion)
        </div>

          <p>Foto</p>
        <div class="editor-field">

            <input type="file" name="archivo" id="archivo" />

            @* @Html.EditorFor(model => model.Url)
            @Html.ValidationMessageFor(model => model.Url) *@
        </div>

        <legend>Marca</legend>

        <select id="Marca_id" name="Marca_id">
           @using (var db = new Pescar2013Shop_MaruMati.Controllers.ShopContext()) {
               foreach (var mar in db.misMarcas) {
                   <option value="@mar.id">@mar.nombre</option>
               }
         }
       </select>

        <p>
            <input type="submit" value="Crear" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Volver", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
    </body></html>